var fs = require("fs");
var a = fs.readFileSync('input4.json');
let read = JSON.parse(a)


let c = []
read.forEach(element => {
    console.log(element.length)
    let tmp = {
        label: element[0]["一级行政区划(Adm1)"],
        value: element[0].value,
        children: element
    }
    c.push(tmp)
});

fs.writeFile('input5.json', JSON.stringify(c), function (err) {
    if (err) {
        return console.error(err);
    }
    console.log("数据写入成功！");
    console.log("--------我是分割线-------------")
    console.log("读取写入的数据！");

});